package com.sumainfor.pc.gmio.controller.assistant;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.QueryHousingService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Eddy·Chen
 * @Email 835033913@qq.com
 * @Create 2019-03-07 10:06
 * 疑问房源
 */
@RestController
@RequestMapping("/queryHousing")
public class QueryHousingController {

    @Autowired
    private QueryHousingService qhs;

    /**
     * 查询表格数据
     *
     * @param page
     * @param state
     * @return
     */
    @RequestMapping("/getTableList")
    public JsonResult getTableList(Page page, Integer state) {
        return qhs.getTableList(page, state);
    }

    /**
     * 确认通知
     *
     * @param douId
     * @return
     */
    @PostMapping("/setNotification")
    public JsonResult setNotification(String douId) {
        if (StringUtils.isBlank(douId)) {
            return JsonResult.errorForEmpty();
        }
        return qhs.setNotification(douId);
    }

}
